home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / SYS / s / SaveDesktop.bed < prev    next >
Text File  |  1996-09-26  |  1KB  |  68 lines

  1. /*
  2. ** $VER: SaveDesktop.bed 1.0 (02.01.96)
  3. **
  4. ** Saves the layout of the desktop
  5. ** The parameter QUIT also quit the program
  6. */
  7.  
  8. OPTIONS RESULTS
  9. OPTIONS FAILAT 11
  10. PARSE ARG name quit
  11.  
  12. quit = UPPER(quit)
  13.  
  14. IF name = "" THEN DO
  15.     RequestFile SAVEMODE 'TITLE "Select File to Save as Layout"' 'PATTERN "#?.layout"' 'BED:Support/'
  16.     IF RC ~= 0 THEN EXIT
  17.     name = RESULT
  18. END
  19.  
  20. IF RIGHT(name,7) ~= ".layout" THEN name = name || ".layout"
  21.  
  22. ADDRESS BED
  23.  
  24. GetDocuments
  25. docs = RESULT
  26.  
  27. i = 0
  28.  
  29. IF Open(save,name,WRITE) THEN DO
  30.     DO WHILE docs ~= ""
  31.         PARSE VAR docs '"'.'"' port docs
  32.  
  33.         ADDRESS VALUE port
  34.  
  35.         GetFilePath
  36.         WriteLn(save,RESULT)
  37.  
  38.         GetWindowInfo
  39.         PARSE VAR RESULT icon x1 y1 w1 h1 .
  40.  
  41.         IconifyWindow TOGGLE
  42.  
  43.         GetWindowInfo
  44.         PARSE VAR RESULT . x2 y2 w2 h2 .
  45.  
  46.         IconifyWindow TOGGLE
  47.  
  48.         IF icon = ON THEN DO
  49.             str = x2 || '/' || y2 || '/' || w2 || '/' || h2 || '/' || x1 || '/' || y1 || '/ICONIFIED'
  50.         END; ELSE DO
  51.             str = x1 || '/' || y1 || '/' || w1 || '/' || h1 || '/' || x2 || '/' || y2
  52.         END
  53.         WriteLn(save,str)
  54.  
  55.         GetCursorPos
  56.         str = WORD(RESULT,1) WORD(RESULT,2)
  57.         WriteLn(save,str)
  58.  
  59.         WriteLn(save,"")
  60.  
  61.         IF quit='QUIT' THEN CloseDoc
  62.  
  63.         i = i+1
  64.     END
  65.  
  66.     Close(save)
  67. END
  68.